

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, goods-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                商品ID：
                <div class="layui-inline">
                    <input type="text" name="id" placeholder="请输入" autocomplete="off" class="layui-input">
                </div>

                店铺ID：
                <div class="layui-inline">
                    <input type="text" name="shopid" placeholder="请输入" autocomplete="off" class="layui-input">
                </div>

                分类：
                <div class="layui-inline">
                    <select name="categoryid">
                        <option value="">不限</option>
                        {volist name="categorys" id="vo"}
                        <option value="{$vo.id}">{$vo.title}</option>
                        {/volist}
                    </select>
                </div>

                状态：
                <div class="layui-inline">
                    <select name="status">
                        <option value="">不限</option>
                        <option value="0">待审核</option>
                        <option value="1">已上架</option>
                        <option value="2">已下架</option>
                        <option value="3">已拒绝</option>
                    </select>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-goodslist" lay-submit lay-filter="LAY-goods-front-search">
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>
            </div>
        </div>

        <div class="layui-card-body">

            <table id="LAY-goods-manage" lay-filter="LAY-goods-manage"></table>

            <script type="text/html" id="table-goodslist-operation">
                {{#  if(d.status == 0 || d.status == 3){ }}
                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="check"><i class="layui-icon layui-icon-edit"></i>审核</a>
                {{#  } else if(d.status == 1){ }}
                <a class="layui-btn layui-btn-xs" lay-event="sale_off"><i class="layui-icon layui-icon-delete"></i>下架</a>
                {{#  } else if(d.status == 2) { }}
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="sale_on"><i class="layui-icon layui-icon-delete"></i>上架</a>
                {{#  } }}

            </script>
        </div>
    </div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'shop', 'table'], function(){
        var $ = layui.$
            ,form = layui.form
            ,table = layui.table;

        //监听搜索
        form.on('submit(LAY-goods-front-search)', function(data){
            var field = data.field;

            //执行重载
            table.reload('LAY-goods-manage', {
                where: field
            });
        });
    });
</script>
</body>
</html>
